﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using System.Data.SqlClient;

namespace DAL
{
    public class ETLSYSJobConfigStepPredecessorsDAL: DB
    {
        public ETLSYSJobConfigStepPredecessorsDAL(LoginInfo info)
        {
            base.loginInfo = info;
        }
        public bool Add(ETLSYSJobConfigStepPredecessors data)
        {
            bool result = true;
            try
            {
                HIDB.dbo con = base.conn();
                SqlParameter[] sqlparams = new SqlParameter[]
                { 
                     new  SqlParameter("@GUID",data.GUID)
                    ,new  SqlParameter("@StepID",data.StepID)
                    ,new  SqlParameter("@StepParentID",data.StepParentID)
                };
                con.ExecuteSql("INSERT INTO Working_db.ETL_SYS_JobConfig_Step_Predecessors([GUID],StepID,StepParentID)	VALUES(@GUID,@StepID,@StepParentID)", sqlparams);
            }
            catch (Exception)
            {
                result = false;
                throw;
            }
            return result;
        }
    }
}
